Setup

knitr::opts_chunk$set(echo = TRUE)

library(tidyverse)
library(R.utils)
library(wbCorr)
library(readxl)
library(kableExtra)
library(brms)
library(bayesplot)

top_directory <- file.path(
  'C:', 'Users', 'kueng', 'OneDrive - Universität Zürich UZH',
  '04 Papers', '02 T&T Control', 'Analysis', 'ACTIVITY', 'BRMS'
)

working_directory <- file.path(top_directory, 'SensitivityCovariates')
setwd(working_directory)

functions_directory <- file.path('C:', 'Users', 'kueng', 
                                 'OneDrive - Universität Zürich UZH', 
                                 'RFunctions')

source(file.path(functions_directory, 'ReportModels.R'))
source(file.path(functions_directory, 'PrettyTables.R'))
source(file.path(functions_directory, 'ReportMeasures.R'))
source(file.path(top_directory, 'Functions', 'PrepareData.R'))
system("shutdown /a")
## [1] 1116
# Set options for analysis
use_mi = FALSE
shutdown = FALSE
report_ordinal = FALSE

options(
  dplyr.print_max = 100, 
  brms.backend = 'cmdstan',
  brms.file_refit = ifelse(use_mi, 'never', 'on_change'),
  error = function() beepr::beep(sound = 5)
)
df <- openxlsx::read.xlsx(file.path(top_directory, 'long.xlsx'))
df_original <- df

df_double <- prepare_data(df, use_mi = use_mi)[[1]]

Constructing scales Re-coding pusing reshaping data (4field) centering data within and between

Modelling

# For indistinguishable Dyads
model_rows_fixed <- c(
    'Intercept', 
    # '-- WITHIN PERSON MAIN EFFECTS --', 
    'persuasion_self_cw', 
    'persuasion_partner_cw', 
    'pressure_self_cw', 
    'pressure_partner_cw', 
    'pushing_self_cw', 
    'pushing_partner_cw', 
    'day', 
    'weartime_self_cw',
    
    'support_self_cw',
    'support_partner_cw',
    'isWeekendWeekend',
    'got_JITAI_selfJITAIreceived',
    'skilled_supportDaysafterIntervention',
    
    
    # '-- BETWEEN PERSON MAIN EFFECTS',
    'persuasion_self_cb',
    'persuasion_partner_cb',
    'pressure_self_cb',
    'pressure_partner_cb',
    'pushing_self_cb',
    'pushing_partner_cb',
    'weartime_self_cb',
    'studyGroupFirst3weeksinterventions',
    'studyGrouplast3weeksinterventions'
  )


model_rows_fixed_ordinal <- c(
  model_rows_fixed[1],
  'Intercept[1]',
  'Intercept[2]',
  'Intercept[3]',
  'Intercept[4]',
  'Intercept[5]',
  model_rows_fixed[2:length(model_rows_fixed)]
)

model_rows_random <- c(
  # '--------------',
  # '-- RANDOM EFFECTS --',
  'sd(Intercept)', 
  'sd(persuasion_self_cw)',
  'sd(persuasion_partner_cw)',
  'sd(pressure_self_cw)',
  'sd(pressure_partner_cw)',
  'sd(pushing_self_cw)',
  'sd(pushing_partner_cw)',
  # '-- CORRELATION STRUCTURE -- ', 
  'ar[1]', 
  'nu',
  'shape',
  'sderr',
  'sigma'
)

model_rows_random_ordinal <- c(model_rows_random,'disc')
# For indistinguishable Dyads
model_rownames_fixed <- c(
    'Intercept', 
    # '-- WITHIN PERSON MAIN EFFECTS --', 
    'Daily perceived persuasion target -> target', 
    'Daily perceived persuasion target -> agent', 
    'Daily perceived pressure target -> target', 
    'Daily perceived pressure target -> agent', 
    'Daily perceived pushing target -> target', 
    'Daily perceived pushing target -> agent', 
    'Day', 
    'Daily weartime',
    
    'Daily perceived support target -> target',
    'Daily perceived support target -> agent',
    'Is a weekend',
    'JITAI received',
    'Days post skilled support intervention',
    
    # '-- BETWEEN PERSON MAIN EFFECTS',
    'Mean perceived persuasion target -> target',
    'Mean Perceived persuasion target -> agent',
    'Mean Perceived pressure target -> target',
    'Mean Perceived pressure target -> agent',
    'Mean Perceived pushing target -> target',
    'Mean Perceived pushing target -> agent',
    'Mean weartime',
    
    'Difference study group 2',
    'Difference study group 3'
  )


model_rownames_fixed_ordinal <- c(
  model_rownames_fixed[1],
  'Intercept[1]',
  'Intercept[2]',
  'Intercept[3]',
  'Intercept[4]',
  'Intercept[5]',
  model_rownames_fixed[2:length(model_rownames_fixed)]
)

model_rownames_random <- c(
  # '--------------',
  # '-- RANDOM EFFECTS --',
  'sd(Intercept)', 
  'sd(Daily perceived persuasion target -> target)', 
  'sd(Daily perceived persuasion target -> agent)', 
  'sd(Daily perceived pressure target -> target)', 
  'sd(Daily perceived pressure target -> agent)', 
  'sd(Daily perceived pushing target -> target)', 
  'sd(Daily perceived pushing target -> agent)', 
  # '-- CORRELATION STRUCTURE -- ', 
  'ar[1]', 
  'nu',
  'shape',
  'sderr',
  'sigma'
)

model_rownames_random_ordinal <- c(model_rownames_random,'disc')
rows_to_pack <- list(
  "Within-Person Effects" = c(2,14),
  "Between-Person Effects" = c(15,23),
  "Random Effects" = c(24, 30), 
  "Additional Parameters" = c(31,35)
  )

rows_to_pack_ordinal <- list(
  "Intercepts" = c(1,6),
  "Within-Person Effects" = c(2+5,14+5),
  "Between-Person Effects" = c(15+5,23+5),
  "Random Effects" = c(24+5, 30+5), 
  "Additional Parameters" = c(31+5,35+6)
  )

Subjective MVPA

range(df_double$pa_sub, na.rm = T) 
## [1]   0 720
hist(df_double$pa_sub, breaks = 100) 

Modelling using the gaussian family fails. Due to the many zeros, transformations won’t help estimating the models. We employ the negative binomial family.

formula <- bf(
  pa_sub ~ 
    persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw +
    #barriers_self_cw +
    
    support_self_cw + support_partner_cw + 
    #comf_self_cw + reas_self_cw + 
    #isWeekend + 
    #got_JITAI_self + skilled_support +
    
    persuasion_self_cb + persuasion_partner_cb +
    pressure_self_cb + pressure_partner_cb +
    pushing_self_cb + pushing_partner_cb +
    
    
    #studyGroup +
    
    day + 
    
    # Random effects
    (persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw | coupleID),

  autocor = ~ ar(time = day, gr = coupleID:userID, p = 1)
)




prior1 <- c(
  brms::set_prior("normal(0, 2.5)", class = "b"),
  brms::set_prior("normal(0, 50)", class = "Intercept", lb = 0),
  
  brms::set_prior("normal(0, 10)", class = "sd", group = "coupleID", lb = 0),
  
  brms::set_prior("cauchy(0, 5)", class = "ar", lb = -1, ub = 1),
  brms::set_prior("cauchy(0, 20)", class = "shape"), 
  brms::set_prior("cauchy(0, 10)", class='sderr')
)

#df_minimal <- df_double[, c("userID", all.vars(as.formula(formula)))]

pa_sub <- my_brm(
  mi = use_mi, 
  imputed_data = implist,
  
  formula = formula, 
  prior = prior1,
  data = df_double, 
  family = brms::negbinomial(),
  #control = list(adapt_delta = 0.99),
  iter = 5000,
  warmup = 2000,
  chains = 4,
  cores = 4,
  seed = 7777,
  file = file.path(working_directory, "models_cache/OnlyExchangeProcesses_pa_sub")
)
pp_check(pa_sub, type='hist')
## Using 10 posterior draws for ppc type 'hist' by default.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

pp_check(pa_sub)
## Using 10 posterior draws for ppc type 'dens_overlay' by default.

loo(pa_sub)
## 
## Computed from 12000 by 3732 log-likelihood matrix.
## 
##          Estimate    SE
## elpd_loo -12017.4 177.6
## p_loo        34.3   3.5
## looic     24034.8 355.1
## ------
## MCSE of elpd_loo is NA.
## MCSE and ESS estimates assume MCMC draws (r_eff in [0.3, 1.7]).
## 
## Pareto k diagnostic values:
##                          Count Pct.    Min. ESS
## (-Inf, 0.7]   (good)     3727  99.9%   420     
##    (0.7, 1]   (bad)         5   0.1%   <NA>    
##    (1, Inf)   (very bad)    0   0.0%   <NA>    
## See help('pareto-k-diagnostic') for details.
plot(pa_sub, ask = FALSE)

summarize_brms(
  pa_sub, 
  model_rows_fixed = model_rows_fixed,
  model_rows_random = model_rows_random,
  model_rownames_fixed = model_rownames_fixed,
  model_rownames_random = model_rownames_random,
  exponentiate = T) %>%
  print_df(rows_to_pack = rows_to_pack)
IRR l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept 25.51* 19.55 33.83 1.000 4071.59 6449.41
Within-Person Effects
Daily perceived persuasion target -> target 1.05 0.94 1.19 1.000 12037.55 8879.92
Daily perceived persuasion target -> agent 1.05 0.93 1.18 1.000 14133.51 8985.77
Daily perceived pressure target -> target 0.94 0.71 1.28 1.000 11618.85 8604.13
Daily perceived pressure target -> agent 1.20 0.91 1.66 1.000 12929.51 8865.32
Daily perceived pushing target -> target 1.08 0.89 1.33 1.000 9472.90 7893.89
Daily perceived pushing target -> agent 1.05 0.89 1.25 1.001 13512.98 8591.27
Day 0.80 0.58 1.09 1.000 15337.41 9294.84
Daily weartime NA NA NA NA NA NA
Daily perceived support target -> target 1.24* 1.16 1.34 1.000 14594.76 8850.07
Daily perceived support target -> agent 1.20* 1.11 1.30 1.000 15653.44 9507.86
Is a weekend NA NA NA NA NA NA
JITAI received NA NA NA NA NA NA
Days post skilled support intervention NA NA NA NA NA NA
Between-Person Effects
Mean perceived persuasion target -> target 1.66 0.85 3.29 1.001 3388.49 5239.42
Mean Perceived persuasion target -> agent 1.20 0.62 2.38 1.000 3436.09 4943.52
Mean Perceived pressure target -> target 0.54 0.24 1.21 1.001 4862.17 7863.54
Mean Perceived pressure target -> agent 0.40* 0.18 0.90 1.000 5301.46 6814.47
Mean Perceived pushing target -> target 1.50 0.54 4.11 1.000 4202.49 6847.75
Mean Perceived pushing target -> agent 2.11 0.73 5.92 1.000 4233.32 6107.48
Mean weartime NA NA NA NA NA NA
Difference study group 2 NA NA NA NA NA NA
Difference study group 3 NA NA NA NA NA NA
Random Effects
sd(Intercept) 0.64 0.47 0.84 1.00 3883.80 7092.52
sd(Daily perceived persuasion target -> target) 0.08 0.00 0.21 1.00 5261.11 5673.47
sd(Daily perceived persuasion target -> agent) 0.07 0.00 0.19 1.00 6525.53 5949.93
sd(Daily perceived pressure target -> target) 0.16 0.01 0.50 1.00 6440.74 5003.51
sd(Daily perceived pressure target -> agent) 0.17 0.01 0.50 1.00 7021.53 5141.09
sd(Daily perceived pushing target -> target) 0.24 0.01 0.54 1.00 3497.53 3810.22
sd(Daily perceived pushing target -> agent) 0.11 0.00 0.30 1.00 6045.90 5325.69
Additional Parameters
ar[1] 0.03 -0.92 0.95 1.00 10636.36 7177.35
nu NA NA NA NA NA NA
shape 0.14 0.13 0.15 1.00 16011.31 8958.76
sderr 0.05 0.00 0.15 1.00 5641.93 5434.64
sigma NA NA NA NA NA NA

Device Based MVPA

range(df_double$pa_obj, na.rm = T) 
## [1]   5.75 971.25
hist(df_double$pa_obj, breaks = 50)

df_double$pa_obj_log <- log(df_double$pa_obj)

hist(df_double$pa_obj_log, breaks = 50)

We tried negative binomial here as well for consistency, but the model did not converge. Poisson also did not work. As we have no zeros in this distribution, we log transform.

formula <- bf(
  pa_obj_log ~ 
    persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw +
    #barriers_self_cw +
    
    support_self_cw + support_partner_cw + 
    #comf_self_cw + reas_self_cw + 
    #isWeekend + 
    #got_JITAI_self + skilled_support +
    
    persuasion_self_cb + persuasion_partner_cb +
    pressure_self_cb + pressure_partner_cb +
    pushing_self_cb + pushing_partner_cb +
    
    
    #studyGroup +
    
    day + weartime_self_cw + weartime_self_cb +
    
    # Random effects
    (persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw | coupleID),

  autocor = ~ ar(time = day, gr = coupleID:userID, p = 1)
)



prior1 <- c(
  brms::set_prior("normal(0, 2.5)", class = "b"),
  brms::set_prior("normal(0, 50)", class = "Intercept", lb = 0),
  
  brms::set_prior("normal(0, 10)", class = "sd", group = "coupleID", lb = 0),
  
  brms::set_prior("cauchy(0, 5)", class = "ar", lb = -1, ub = 1),
  brms::set_prior("cauchy(0, 10)", class = "sigma", lb = 0)
)


#df_minimal <- df_double[, c("userID", all.vars(as.formula(formula)))]

pa_obj_log <- my_brm(
  mi = use_mi, 
  imputed_data = implist,
  
  formula = formula, 
  prior = prior1,
  data = df_double, 
  family = gaussian(),
  #control = list(adapt_delta = 0.99),
  iter = 5000,
  warmup = 2000,
  chains = 4,
  cores = 4,
  seed = 7777,
  file = file.path(working_directory, "models_cache/OnlyExchangeProcesses_pa_obj_log")
)
# plotting with the first imputed dataset. 
pp_check(pa_obj_log, type='hist')
## Using 10 posterior draws for ppc type 'hist' by default.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

pp_check(pa_obj_log)
## Using 10 posterior draws for ppc type 'dens_overlay' by default.

loo(pa_obj_log)
## 
## Computed from 12000 by 3333 log-likelihood matrix.
## 
##          Estimate    SE
## elpd_loo  -2797.6  57.0
## p_loo        92.3   4.6
## looic      5595.1 114.0
## ------
## MCSE of elpd_loo is 0.1.
## MCSE and ESS estimates assume MCMC draws (r_eff in [0.4, 2.2]).
## 
## All Pareto k estimates are good (k < 0.7).
## See help('pareto-k-diagnostic') for details.
plot(pa_obj_log, ask = FALSE)

summarize_brms(
  pa_obj_log, 
  model_rows_fixed = model_rows_fixed,
  model_rows_random = model_rows_random,
  model_rownames_fixed = model_rownames_fixed,
  model_rownames_random = model_rownames_random,
  exponentiate = T) %>%
  print_df(rows_to_pack = rows_to_pack)
exp(Est.) l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept 117.69* 105.70 131.09 1.000 4117.26 7398.81
Within-Person Effects
Daily perceived persuasion target -> target 1.01 0.98 1.04 1.001 13890.48 9899.39
Daily perceived persuasion target -> agent 1.00 0.97 1.03 1.000 14834.14 9575.99
Daily perceived pressure target -> target 0.95 0.89 1.01 1.000 20115.04 9856.63
Daily perceived pressure target -> agent 0.98 0.92 1.04 1.000 21252.93 9688.85
Daily perceived pushing target -> target 1.01 0.97 1.06 1.000 15552.07 9539.84
Daily perceived pushing target -> agent 1.02 0.98 1.06 1.000 21009.15 9545.22
Day 0.96 0.88 1.05 1.001 32603.15 8308.08
Daily weartime 1.00* 1.00 1.00 1.000 11941.83 7790.36
Daily perceived support target -> target 1.04* 1.02 1.05 1.000 27798.33 8852.09
Daily perceived support target -> agent 1.02* 1.00 1.04 1.000 27165.94 9200.15
Is a weekend NA NA NA NA NA NA
JITAI received NA NA NA NA NA NA
Days post skilled support intervention NA NA NA NA NA NA
Between-Person Effects
Mean perceived persuasion target -> target 1.09 0.83 1.46 1.001 3992.16 6374.77
Mean Perceived persuasion target -> agent 0.97 0.72 1.30 1.000 4158.27 6601.46
Mean Perceived pressure target -> target 1.00 0.73 1.37 1.000 6124.98 8380.32
Mean Perceived pressure target -> agent 0.95 0.70 1.29 1.000 5669.88 7770.69
Mean Perceived pushing target -> target 1.00 0.65 1.54 1.000 6013.36 7580.50
Mean Perceived pushing target -> agent 1.31 0.86 2.00 1.001 5907.50 7643.74
Mean weartime 1.00 1.00 1.00 1.000 17471.74 10029.68
Difference study group 2 NA NA NA NA NA NA
Difference study group 3 NA NA NA NA NA NA
Random Effects
sd(Intercept) 0.30 0.23 0.39 1.00 4243.01 6416.81
sd(Daily perceived persuasion target -> target) 0.05 0.02 0.08 1.00 6786.68 6423.36
sd(Daily perceived persuasion target -> agent) 0.05 0.02 0.08 1.00 5989.69 4816.92
sd(Daily perceived pressure target -> target) 0.05 0.00 0.14 1.00 6685.54 8016.63
sd(Daily perceived pressure target -> agent) 0.04 0.00 0.10 1.00 8988.04 7344.70
sd(Daily perceived pushing target -> target) 0.06 0.00 0.14 1.00 3197.54 6052.30
sd(Daily perceived pushing target -> agent) 0.03 0.00 0.08 1.00 5923.18 6706.94
Additional Parameters
ar[1] 0.30 0.26 0.33 1.00 27546.04 9221.57
nu NA NA NA NA NA NA
shape NA NA NA NA NA NA
sderr NA NA NA NA NA NA
sigma 0.55 0.54 0.57 1.00 24234.08 9275.33

Affect

range(df_double$aff, na.rm = T) 
## [1] 1 6
hist(df_double$aff, breaks = 15)

formula <- bf(
  aff ~ 
    persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw +
    #barriers_self_cw +
    
    support_self_cw + support_partner_cw + 
    #comf_self_cw + reas_self_cw + 
    #isWeekend + 
    #got_JITAI_self + skilled_support +
    
    persuasion_self_cb + persuasion_partner_cb +
    pressure_self_cb + pressure_partner_cb +
    pushing_self_cb + pushing_partner_cb +
    
    
    #studyGroup +
    
    day +
    
    # Random effects
    (persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw | coupleID),

  autocor = ~ ar(time = day, gr = coupleID:userID, p = 1)
)



prior1 <- c(
  brms::set_prior("normal(0, 5)", class = "b"),
  brms::set_prior("normal(0, 20)", class = "Intercept", lb=0, ub=6), # range of the outcome scale
  
  brms::set_prior("normal(0, 2)", class = "sd", group = "coupleID", lb = 0),

  brms::set_prior("cauchy(0, 5)", class = "ar", lb = -1, ub = 1),
  brms::set_prior("cauchy(0, 10)", class = "sigma", lb = 0)
  
)


df_minimal <- df_double[, c("userID", all.vars(as.formula(formula)))]

mood <- my_brm(
  mi = use_mi, 
  imputed_data = implist,
  
  formula = formula, 
  prior = prior1,
  data = df_double, 
  family = gaussian(),
  #control = list(adapt_delta = 0.95, max_treedepth = 15),
  iter = 5000,
  warmup = 2000,
  chains = 4,
  cores = 4,
  seed = 7777,
  file = file.path(working_directory, "models_cache/OnlyExchangeProcesses_mood")
)
pp_check(mood, type='hist')
## Using 10 posterior draws for ppc type 'hist' by default.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

pp_check(mood)
## Using 10 posterior draws for ppc type 'dens_overlay' by default.

loo(mood)
## 
## Computed from 12000 by 3732 log-likelihood matrix.
## 
##          Estimate    SE
## elpd_loo  -4792.3  63.8
## p_loo        91.7   4.7
## looic      9584.5 127.5
## ------
## MCSE of elpd_loo is 0.1.
## MCSE and ESS estimates assume MCMC draws (r_eff in [0.4, 1.7]).
## 
## All Pareto k estimates are good (k < 0.7).
## See help('pareto-k-diagnostic') for details.
plot(mood, ask = FALSE)

summarize_brms(
  mood, 
  model_rows_fixed = model_rows_fixed,
  model_rows_random = model_rows_random,
  model_rownames_fixed = model_rownames_fixed,
  model_rownames_random = model_rownames_random,
  exponentiate = F) %>%
  print_df(rows_to_pack = rows_to_pack)
b l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept 4.73* 4.52 4.94 1.002 2611.08 5413.08
Within-Person Effects
Daily perceived persuasion target -> target -0.04* -0.07 0.00 1.000 12083.65 9341.98
Daily perceived persuasion target -> agent -0.01 -0.05 0.03 1.000 8942.67 7901.31
Daily perceived pressure target -> target -0.06 -0.17 0.04 1.000 9005.17 7700.31
Daily perceived pressure target -> agent -0.03 -0.16 0.09 1.000 7761.79 6263.02
Daily perceived pushing target -> target 0.00 -0.07 0.06 1.000 8292.67 8763.99
Daily perceived pushing target -> agent 0.05 -0.01 0.10 1.000 9623.03 8834.88
Day 0.23* 0.06 0.39 1.000 15479.26 8889.24
Daily weartime NA NA NA NA NA NA
Daily perceived support target -> target 0.08* 0.05 0.10 1.000 16740.31 9852.22
Daily perceived support target -> agent 0.03* 0.00 0.05 1.000 12682.90 8956.88
Is a weekend NA NA NA NA NA NA
JITAI received NA NA NA NA NA NA
Days post skilled support intervention NA NA NA NA NA NA
Between-Person Effects
Mean perceived persuasion target -> target 0.33 -0.23 0.89 1.001 2056.65 4081.37
Mean Perceived persuasion target -> agent 0.25 -0.32 0.82 1.001 2035.98 3863.65
Mean Perceived pressure target -> target -0.32 -0.92 0.26 1.000 2692.87 4479.88
Mean Perceived pressure target -> agent -0.28 -0.87 0.31 1.001 2688.04 4511.54
Mean Perceived pushing target -> target 0.22 -0.58 1.01 1.002 3368.22 5635.24
Mean Perceived pushing target -> agent 0.32 -0.47 1.10 1.002 3276.34 5859.09
Mean weartime NA NA NA NA NA NA
Difference study group 2 NA NA NA NA NA NA
Difference study group 3 NA NA NA NA NA NA
Random Effects
sd(Intercept) 0.59 0.46 0.76 1.00 3002.86 5503.09
sd(Daily perceived persuasion target -> target) 0.03 0.00 0.07 1.00 4635.47 5734.51
sd(Daily perceived persuasion target -> agent) 0.06 0.01 0.11 1.00 3164.48 2777.39
sd(Daily perceived pressure target -> target) 0.12 0.01 0.29 1.00 3250.00 4397.92
sd(Daily perceived pressure target -> agent) 0.17 0.02 0.35 1.00 2929.46 2887.10
sd(Daily perceived pushing target -> target) 0.09 0.01 0.18 1.00 3661.88 3258.07
sd(Daily perceived pushing target -> agent) 0.05 0.00 0.13 1.00 4555.01 4819.84
Additional Parameters
ar[1] 0.45 0.42 0.48 1.00 14465.17 9277.42
nu NA NA NA NA NA NA
shape NA NA NA NA NA NA
sderr NA NA NA NA NA NA
sigma 0.86 0.84 0.88 1.00 14603.05 9170.32

reactance

range(df_double$reactance, na.rm = T) 
## [1] 0 5
hist(df_double$reactance, breaks = 6)

formula <- bf(
  reactance ~ 
    persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw +
    #barriers_self_cw +
    
    support_self_cw + support_partner_cw + 
    #comf_self_cw + reas_self_cw + 
    #isWeekend + 
    #got_JITAI_self + skilled_support +
    
    persuasion_self_cb + persuasion_partner_cb +
    pressure_self_cb + pressure_partner_cb +
    pushing_self_cb + pushing_partner_cb +
    
    
    #studyGroup +
    
    day +
    
    # Random effects
    (persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw | coupleID),

  autocor = ~ ar(time = day, gr = coupleID:userID, p = 1)
)



prior1 <- c(
  brms::set_prior("normal(0, 5)", class = "b"),
  brms::set_prior("normal(0, 20)", class = "Intercept", lb=0, ub=5), # range of the outcome scale
  
  brms::set_prior("normal(0, 2)", class = "sd", group = "coupleID", lb = 0),

  brms::set_prior("cauchy(0, 5)", class = "ar", lb = -1, ub = 1),
  brms::set_prior("cauchy(0, 10)", class = "sigma", lb = 0)
)


df_minimal <- df_double[, c("userID", all.vars(as.formula(formula)))]

reactance <- my_brm(
  mi = use_mi, 
  imputed_data = implist,
  
  formula = formula, 
  prior = prior1,
  data = df_double, 
  family = gaussian(),
  #control = list(adapt_delta = 0.95, max_treedepth = 15),
  iter = 5000,
  warmup = 2000,
  chains = 4,
  cores = 4,
  seed = 7777,
  file = file.path(working_directory,"models_cache/OnlyExchangeProcesses_reactance")

)
pp_check(reactance, type='hist')
## Using 10 posterior draws for ppc type 'hist' by default.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

pp_check(reactance)
## Using 10 posterior draws for ppc type 'dens_overlay' by default.

loo(reactance)
## 
## Computed from 12000 by 755 log-likelihood matrix.
## 
##          Estimate   SE
## elpd_loo  -1056.3 35.4
## p_loo        75.6  7.4
## looic      2112.6 70.7
## ------
## MCSE of elpd_loo is NA.
## MCSE and ESS estimates assume MCMC draws (r_eff in [0.5, 1.6]).
## 
## Pareto k diagnostic values:
##                          Count Pct.    Min. ESS
## (-Inf, 0.7]   (good)     747   98.9%   149     
##    (0.7, 1]   (bad)        8    1.1%   <NA>    
##    (1, Inf)   (very bad)   0    0.0%   <NA>    
## See help('pareto-k-diagnostic') for details.
plot(reactance, ask = FALSE)

summary(reactance)
##  Family: gaussian 
##   Links: mu = identity; sigma = identity 
## Formula: reactance ~ persuasion_self_cw + persuasion_partner_cw + pressure_self_cw + pressure_partner_cw + pushing_self_cw + pushing_partner_cw + support_self_cw + support_partner_cw + persuasion_self_cb + persuasion_partner_cb + pressure_self_cb + pressure_partner_cb + pushing_self_cb + pushing_partner_cb + day + (persuasion_self_cw + persuasion_partner_cw + pressure_self_cw + pressure_partner_cw + pushing_self_cw + pushing_partner_cw | coupleID) 
##          autocor ~ ar(time = day, gr = coupleID:userID, p = 1)
##    Data: data (Number of observations: 755) 
##   Draws: 4 chains, each with iter = 5000; warmup = 2000; thin = 1;
##          total post-warmup draws = 12000
## 
## Correlation Structures:
##       Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## ar[1]     0.02      0.04    -0.06     0.11 1.00    16345     9862
## 
## Multilevel Hyperparameters:
## ~coupleID (Number of levels: 38) 
##                                                Estimate Est.Error l-95% CI u-95% CI Rhat
## sd(Intercept)                                      0.27      0.07     0.15     0.42 1.00
## sd(persuasion_self_cw)                             0.05      0.04     0.00     0.13 1.00
## sd(persuasion_partner_cw)                          0.04      0.03     0.00     0.12 1.00
## sd(pressure_self_cw)                               0.38      0.10     0.21     0.60 1.00
## sd(pressure_partner_cw)                            0.22      0.16     0.01     0.59 1.00
## sd(pushing_self_cw)                                0.10      0.06     0.01     0.22 1.00
## sd(pushing_partner_cw)                             0.05      0.04     0.00     0.15 1.00
## cor(Intercept,persuasion_self_cw)                 -0.34      0.34    -0.85     0.44 1.00
## cor(Intercept,persuasion_partner_cw)               0.03      0.34    -0.63     0.67 1.00
## cor(persuasion_self_cw,persuasion_partner_cw)     -0.03      0.35    -0.68     0.64 1.00
## cor(Intercept,pressure_self_cw)                    0.15      0.28    -0.41     0.66 1.00
## cor(persuasion_self_cw,pressure_self_cw)          -0.01      0.33    -0.65     0.61 1.00
## cor(persuasion_partner_cw,pressure_self_cw)       -0.00      0.35    -0.66     0.66 1.00
## cor(Intercept,pressure_partner_cw)                 0.00      0.31    -0.60     0.61 1.00
## cor(persuasion_self_cw,pressure_partner_cw)        0.06      0.35    -0.62     0.70 1.00
## cor(persuasion_partner_cw,pressure_partner_cw)     0.00      0.35    -0.66     0.67 1.00
## cor(pressure_self_cw,pressure_partner_cw)         -0.17      0.32    -0.72     0.49 1.00
## cor(Intercept,pushing_self_cw)                     0.07      0.31    -0.55     0.66 1.00
## cor(persuasion_self_cw,pushing_self_cw)           -0.05      0.34    -0.68     0.62 1.00
## cor(persuasion_partner_cw,pushing_self_cw)         0.06      0.35    -0.61     0.70 1.00
## cor(pressure_self_cw,pushing_self_cw)             -0.12      0.32    -0.70     0.53 1.00
## cor(pressure_partner_cw,pushing_self_cw)           0.04      0.36    -0.64     0.69 1.00
## cor(Intercept,pushing_partner_cw)                  0.03      0.35    -0.63     0.67 1.00
## cor(persuasion_self_cw,pushing_partner_cw)        -0.00      0.36    -0.68     0.67 1.00
## cor(persuasion_partner_cw,pushing_partner_cw)     -0.03      0.35    -0.68     0.65 1.00
## cor(pressure_self_cw,pushing_partner_cw)          -0.06      0.35    -0.69     0.63 1.00
## cor(pressure_partner_cw,pushing_partner_cw)        0.02      0.36    -0.65     0.68 1.00
## cor(pushing_self_cw,pushing_partner_cw)            0.04      0.35    -0.64     0.69 1.00
##                                                Bulk_ESS Tail_ESS
## sd(Intercept)                                      5623     8111
## sd(persuasion_self_cw)                             3529     5213
## sd(persuasion_partner_cw)                          6757     7570
## sd(pressure_self_cw)                               6987     8331
## sd(pressure_partner_cw)                            3280     5246
## sd(pushing_self_cw)                                3671     4787
## sd(pushing_partner_cw)                             8817     7898
## cor(Intercept,persuasion_self_cw)                  7544     8519
## cor(Intercept,persuasion_partner_cw)              16514     8279
## cor(persuasion_self_cw,persuasion_partner_cw)     15016     9549
## cor(Intercept,pressure_self_cw)                    5792     8030
## cor(persuasion_self_cw,pressure_self_cw)           4476     7555
## cor(persuasion_partner_cw,pressure_self_cw)        4565     7681
## cor(Intercept,pressure_partner_cw)                12868     9766
## cor(persuasion_self_cw,pressure_partner_cw)        9217     9408
## cor(persuasion_partner_cw,pressure_partner_cw)     8101     9726
## cor(pressure_self_cw,pressure_partner_cw)         12513    10539
## cor(Intercept,pushing_self_cw)                    12364     8843
## cor(persuasion_self_cw,pushing_self_cw)            9180     9085
## cor(persuasion_partner_cw,pushing_self_cw)         8570     9645
## cor(pressure_self_cw,pushing_self_cw)             11196     9543
## cor(pressure_partner_cw,pushing_self_cw)           8678    10317
## cor(Intercept,pushing_partner_cw)                 20478     9493
## cor(persuasion_self_cw,pushing_partner_cw)        16590     8954
## cor(persuasion_partner_cw,pushing_partner_cw)     13136     9525
## cor(pressure_self_cw,pushing_partner_cw)          14996     9370
## cor(pressure_partner_cw,pushing_partner_cw)       11191    10493
## cor(pushing_self_cw,pushing_partner_cw)           10362    10075
## 
## Regression Coefficients:
##                       Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## Intercept                 0.55      0.09     0.37     0.74 1.00    15141    10651
## persuasion_self_cw       -0.02      0.03    -0.08     0.04 1.00    17163     9509
## persuasion_partner_cw     0.02      0.04    -0.05     0.09 1.00    17995     9601
## pressure_self_cw          0.26      0.11     0.04     0.47 1.00    10125     9283
## pressure_partner_cw       0.13      0.11    -0.07     0.36 1.00     9412     7605
## pushing_self_cw           0.10      0.04     0.02     0.18 1.00    12511     9509
## pushing_partner_cw       -0.01      0.04    -0.09     0.08 1.00    17340     8488
## support_self_cw          -0.07      0.03    -0.13    -0.02 1.00    21098     9379
## support_partner_cw       -0.03      0.03    -0.08     0.02 1.00    22000     9813
## persuasion_self_cb        0.08      0.19    -0.30     0.45 1.00     9032     9023
## persuasion_partner_cb     0.11      0.21    -0.30     0.52 1.00     8854     8834
## pressure_self_cb          0.60      0.21     0.19     1.02 1.00    10695     8092
## pressure_partner_cb       0.20      0.22    -0.23     0.64 1.00    10724     9683
## pushing_self_cb          -0.27      0.27    -0.81     0.27 1.00    10225     9594
## pushing_partner_cb       -0.61      0.29    -1.19    -0.03 1.00    11545     9782
## day                       0.07      0.14    -0.19     0.33 1.00    20514     9592
## 
## Further Distributional Parameters:
##       Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## sigma     0.93      0.03     0.88     0.98 1.00    14332     8933
## 
## Draws were sampled using sample(hmc). For each parameter, Bulk_ESS
## and Tail_ESS are effective sample size measures, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).
summarize_brms(
  reactance, 
  model_rows_fixed = model_rows_fixed,
  model_rows_random = model_rows_random,
  model_rownames_fixed = model_rownames_fixed,
  model_rownames_random = model_rownames_random,
  exponentiate = F) %>%
  print_df(rows_to_pack = rows_to_pack)
b l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept 0.55* 0.37 0.74 1.000 15141.24 10650.95
Within-Person Effects
Daily perceived persuasion target -> target -0.02 -0.08 0.04 1.001 17163.29 9509.22
Daily perceived persuasion target -> agent 0.02 -0.05 0.09 1.000 17994.52 9601.24
Daily perceived pressure target -> target 0.26* 0.04 0.47 1.000 10125.19 9282.52
Daily perceived pressure target -> agent 0.13 -0.07 0.36 1.001 9412.20 7605.08
Daily perceived pushing target -> target 0.10* 0.02 0.18 1.001 12511.01 9509.29
Daily perceived pushing target -> agent -0.01 -0.09 0.08 1.000 17339.61 8488.12
Day 0.07 -0.19 0.33 1.000 20514.09 9592.11
Daily weartime NA NA NA NA NA NA
Daily perceived support target -> target -0.07* -0.13 -0.02 1.000 21097.51 9378.54
Daily perceived support target -> agent -0.03 -0.08 0.02 1.000 22000.36 9812.73
Is a weekend NA NA NA NA NA NA
JITAI received NA NA NA NA NA NA
Days post skilled support intervention NA NA NA NA NA NA
Between-Person Effects
Mean perceived persuasion target -> target 0.08 -0.30 0.45 1.000 9031.63 9023.25
Mean Perceived persuasion target -> agent 0.11 -0.30 0.52 1.000 8854.18 8833.77
Mean Perceived pressure target -> target 0.60* 0.19 1.02 1.001 10694.60 8092.24
Mean Perceived pressure target -> agent 0.20 -0.23 0.64 1.000 10724.25 9682.92
Mean Perceived pushing target -> target -0.27 -0.81 0.27 1.000 10224.57 9594.26
Mean Perceived pushing target -> agent -0.61* -1.19 -0.03 1.000 11545.22 9782.24
Mean weartime NA NA NA NA NA NA
Difference study group 2 NA NA NA NA NA NA
Difference study group 3 NA NA NA NA NA NA
Random Effects
sd(Intercept) 0.27 0.15 0.42 1.00 5622.90 8111.02
sd(Daily perceived persuasion target -> target) 0.05 0.00 0.13 1.00 3528.70 5212.87
sd(Daily perceived persuasion target -> agent) 0.04 0.00 0.12 1.00 6757.27 7570.19
sd(Daily perceived pressure target -> target) 0.38 0.21 0.60 1.00 6986.92 8330.64
sd(Daily perceived pressure target -> agent) 0.22 0.01 0.59 1.00 3279.72 5245.99
sd(Daily perceived pushing target -> target) 0.10 0.01 0.22 1.00 3670.79 4786.74
sd(Daily perceived pushing target -> agent) 0.05 0.00 0.15 1.00 8817.37 7897.73
Additional Parameters
ar[1] 0.02 -0.06 0.11 1.00 16344.73 9862.13
nu NA NA NA NA NA NA
shape NA NA NA NA NA NA
sderr NA NA NA NA NA NA
sigma 0.93 0.88 0.98 1.00 14332.14 8933.07

Binary Version

introduce_binary_reactance <- function(data) {
  data$is_reactance <- factor(data$reactance > 0, levels = c(FALSE, TRUE), labels = c(0, 1))
  return(data)
}



df_double <- introduce_binary_reactance(df_double)
if (use_mi) {
  for (i in seq_along(implist)) {
    implist[[i]] <- introduce_binary_reactance(implist[[i]])
  }
}


formula <- bf(
  is_reactance ~ 
    persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw +
    #barriers_self_cw +
    
    support_self_cw + support_partner_cw + support_partner_cw +
    #comf_self_cw + reas_self_cw + 
    #isWeekend + 
    #got_JITAI_self + skilled_support +
    
    persuasion_self_cb + persuasion_partner_cb +
    pressure_self_cb + pressure_partner_cb +
    pushing_self_cb + pushing_partner_cb +
    
    
    #studyGroup +
    
    day +
    
    # Random effects
    (persuasion_self_cw + persuasion_partner_cw +
    pressure_self_cw + pressure_partner_cw +
    pushing_self_cw + pushing_partner_cw | coupleID),

  autocor = ~ ar(time = day, gr = coupleID:userID, p = 1)
)



prior1 <- c(
  brms::set_prior("normal(0, 5)", class = "b"),
  brms::set_prior("normal(0, 20)", class = "Intercept", lb=0, ub=5), # range of the outcome scale
  
  brms::set_prior("normal(0, 2)", class = "sd", group = "coupleID", lb = 0),

  brms::set_prior("cauchy(0, 5)", class = "ar", lb = -1, ub = 1)
  #brms::set_prior("cauchy(0, 10)", class = "sigma", lb = 0)
)


df_minimal <- df_double[, c("userID", all.vars(as.formula(formula)))]

is_reactance <- my_brm(
  mi = use_mi, 
  imputed_data = implist,
  
  formula = formula, 
  prior = prior1,
  data = df_double, 
  family = bernoulli(),
  #control = list(adapt_delta = 0.95, max_treedepth = 15),
  iter = 5000,
  warmup = 2000,
  chains = 4,
  cores = 4,
  seed = 7777,
  file = file.path(working_directory, "models_cache/OnlyExchangeProcesses_is_reactance")
)
pp_check(is_reactance, type='hist')
## Using 10 posterior draws for ppc type 'hist' by default.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

pp_check(is_reactance)
## Using 10 posterior draws for ppc type 'dens_overlay' by default.

try(loo(is_reactance))
## 
## Computed from 12000 by 755 log-likelihood matrix.
## 
##          Estimate   SE
## elpd_loo   -385.2 15.3
## p_loo       339.6 14.1
## looic       770.5 30.7
## ------
## MCSE of elpd_loo is NA.
## MCSE and ESS estimates assume MCMC draws (r_eff in [0.6, 1.2]).
## 
## Pareto k diagnostic values:
##                          Count Pct.    Min. ESS
## (-Inf, 0.7]   (good)       1    0.1%   1092    
##    (0.7, 1]   (bad)      246   32.6%   <NA>    
##    (1, Inf)   (very bad) 508   67.3%   <NA>    
## See help('pareto-k-diagnostic') for details.
plot(is_reactance, ask = FALSE)

summarize_brms(
  is_reactance, 
  model_rows_fixed = model_rows_fixed,
  model_rows_random = model_rows_random,
  model_rownames_fixed = model_rownames_fixed,
  model_rownames_random = model_rownames_random,
  exponentiate = T) %>%
  print_df(rows_to_pack = rows_to_pack)
OR l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept 0.00* 0.00 0.09 1.001 3965.33 5861.03
Within-Person Effects
Daily perceived persuasion target -> target 0.60 0.20 1.54 1.000 4566.62 5322.19
Daily perceived persuasion target -> agent 3.43 0.86 18.81 1.001 3744.92 5416.88
Daily perceived pressure target -> target 27.75* 3.18 432.47 1.001 3411.29 5130.09
Daily perceived pressure target -> agent 2.31 0.14 46.43 1.001 5421.20 6459.02
Daily perceived pushing target -> target 4.33* 1.34 20.11 1.001 3418.59 4711.11
Daily perceived pushing target -> agent 0.71 0.13 3.71 1.000 5370.15 6737.28
Day 7.15 0.17 435.91 1.000 4873.44 7330.77
Daily weartime NA NA NA NA NA NA
Daily perceived support target -> target 0.38* 0.13 0.88 1.001 4016.94 4706.79
Daily perceived support target -> agent 0.55 0.22 1.24 1.000 4668.05 6027.65
Is a weekend NA NA NA NA NA NA
JITAI received NA NA NA NA NA NA
Days post skilled support intervention NA NA NA NA NA NA
Between-Person Effects
Mean perceived persuasion target -> target 43.25 0.43 7300.58 1.000 3862.74 5949.51
Mean Perceived persuasion target -> agent 9.23 0.07 1335.56 1.000 4651.93 6777.38
Mean Perceived pressure target -> target 8869.95* 13.01 9419358.08 1.000 6408.79 7173.33
Mean Perceived pressure target -> agent 50.13 0.06 65963.05 1.000 6393.92 7813.35
Mean Perceived pushing target -> target 4.91 0.01 5541.92 1.000 6063.49 7499.91
Mean Perceived pushing target -> agent 0.00 0.00 1.93 1.000 6162.54 8239.86
Mean weartime NA NA NA NA NA NA
Difference study group 2 NA NA NA NA NA NA
Difference study group 3 NA NA NA NA NA NA
Random Effects
sd(Intercept) 4.71 2.84 6.99 1.00 3211.17 6007.53
sd(Daily perceived persuasion target -> target) 0.90 0.05 2.25 1.00 1682.48 3742.14
sd(Daily perceived persuasion target -> agent) 2.06 0.59 3.85 1.00 2399.53 2567.19
sd(Daily perceived pressure target -> target) 2.05 0.10 4.87 1.00 1846.10 3606.72
sd(Daily perceived pressure target -> agent) 1.48 0.06 4.17 1.00 4895.97 5035.57
sd(Daily perceived pushing target -> target) 1.10 0.06 2.74 1.00 2324.13 3800.84
sd(Daily perceived pushing target -> agent) 0.94 0.04 2.78 1.00 4745.06 5607.11
Additional Parameters
ar[1] 0.08 -0.11 0.28 1.00 1911.85 3279.40
nu NA NA NA NA NA NA
shape NA NA NA NA NA NA
sderr 9.22 5.50 14.07 1.00 2006.26 3656.18
sigma NA NA NA NA NA NA

Report All Models

if (report_ordinal) {
  model_rows_random_final <- model_rows_random_ordinal
  model_rows_fixed_final <- model_rows_fixed_ordinal
  model_rownames_fixed_final <- model_rownames_fixed_ordinal
  model_rownames_random_final <- model_rownames_random_ordinal
  rows_to_pack_final <- rows_to_pack_ordinal
} else {
  model_rows_random_final <- model_rows_random
  model_rows_fixed_final <- model_rows_fixed
  model_rownames_fixed_final <- model_rownames_fixed
  model_rownames_random_final <- model_rownames_random
  rows_to_pack_final <- rows_to_pack
}



all_models <- report_side_by_side(
  pa_sub,
  pa_obj_log,
  mood,
  reactance,
  is_reactance,
  
  model_rows_random = model_rows_random_final,
  model_rows_fixed = model_rows_fixed_final,
  model_rownames_random = model_rownames_random_final,
  model_rownames_fixed = model_rownames_fixed_final
) 
## [1] "pa_sub"
## [1] "pa_obj_log"
## [1] "mood"
## [1] "reactance"
## [1] "is_reactance"
# pretty printing
summary_all_models <- all_models %>%
  print_df(rows_to_pack = rows_to_pack_final) %>%
  add_header_above(
    c(" ", "Subjective MVPA" = 2, 
      "Device-Based MVPA" = 2, 
      "Mood" = 2,
      "Reactance Gaussian" = 2, 
      "Reactance Dichotome" = 2)
  )

export_xlsx(summary_all_models, 
            rows_to_pack = rows_to_pack_final,
            file.path(working_directory, "Output/OnlyExchangeProcesses_AllModels_SensCovariates.xlsx"),
            merge_option = 'both', 
            simplify_2nd_row = TRUE,
            colwidths = c(40, 7.4, 12.85, 7.4, 12.85,7.4, 12.85,7.4, 12.85,7.4, 12.85),
            line_above_rows = c(1,2,3,28),
            line_below_rows = c(-1))

summary_all_models
Subjective MVPA
Device-Based MVPA
Mood
Reactance Gaussian
Reactance Dichotome
IRR pa_sub 95% CI pa_sub exp(Est.) pa_obj_log 95% CI pa_obj_log b mood 95% CI mood b reactance 95% CI reactance OR is_reactance 95% CI is_reactance
Intercept 25.51* [19.55, 33.83] 117.69* [105.70, 131.09] 4.73* [ 4.52, 4.94] 0.55* [ 0.37, 0.74] 0.00* [ 0.00, 0.09]
Within-Person Effects
Daily perceived persuasion target -> target 1.05 [ 0.94, 1.19] 1.01 [ 0.98, 1.04] -0.04* [-0.07, 0.00] -0.02 [-0.08, 0.04] 0.60 [ 0.20, 1.54]
Daily perceived persuasion target -> agent 1.05 [ 0.93, 1.18] 1.00 [ 0.97, 1.03] -0.01 [-0.05, 0.03] 0.02 [-0.05, 0.09] 3.43 [ 0.86, 18.81]
Daily perceived pressure target -> target 0.94 [ 0.71, 1.28] 0.95 [ 0.89, 1.01] -0.06 [-0.17, 0.04] 0.26* [ 0.04, 0.47] 27.75* [ 3.18, 432.47]
Daily perceived pressure target -> agent 1.20 [ 0.91, 1.66] 0.98 [ 0.92, 1.04] -0.03 [-0.16, 0.09] 0.13 [-0.07, 0.36] 2.31 [ 0.14, 46.43]
Daily perceived pushing target -> target 1.08 [ 0.89, 1.33] 1.01 [ 0.97, 1.06] 0.00 [-0.07, 0.06] 0.10* [ 0.02, 0.18] 4.33* [ 1.34, 20.11]
Daily perceived pushing target -> agent 1.05 [ 0.89, 1.25] 1.02 [ 0.98, 1.06] 0.05 [-0.01, 0.10] -0.01 [-0.09, 0.08] 0.71 [ 0.13, 3.71]
Day 0.80 [ 0.58, 1.09] 0.96 [ 0.88, 1.05] 0.23* [ 0.06, 0.39] 0.07 [-0.19, 0.33] 7.15 [ 0.17, 435.91]
Daily weartime NA NA 1.00* [ 1.00, 1.00] NA NA NA NA NA NA
Daily perceived support target -> target 1.24* [ 1.16, 1.34] 1.04* [ 1.02, 1.05] 0.08* [ 0.05, 0.10] -0.07* [-0.13, -0.02] 0.38* [ 0.13, 0.88]
Daily perceived support target -> agent 1.20* [ 1.11, 1.30] 1.02* [ 1.00, 1.04] 0.03* [ 0.00, 0.05] -0.03 [-0.08, 0.02] 0.55 [ 0.22, 1.24]
Is a weekend NA NA NA NA NA NA NA NA NA NA
JITAI received NA NA NA NA NA NA NA NA NA NA
Days post skilled support intervention NA NA NA NA NA NA NA NA NA NA
Between-Person Effects
Mean perceived persuasion target -> target 1.66 [ 0.85, 3.29] 1.09 [ 0.83, 1.46] 0.33 [-0.23, 0.89] 0.08 [-0.30, 0.45] 43.25 [ 0.43, 7300.58]
Mean Perceived persuasion target -> agent 1.20 [ 0.62, 2.38] 0.97 [ 0.72, 1.30] 0.25 [-0.32, 0.82] 0.11 [-0.30, 0.52] 9.23 [ 0.07, 1335.56]
Mean Perceived pressure target -> target 0.54 [ 0.24, 1.21] 1.00 [ 0.73, 1.37] -0.32 [-0.92, 0.26] 0.60* [ 0.19, 1.02] 8869.95* [13.01, 9419358.08]
Mean Perceived pressure target -> agent 0.40* [ 0.18, 0.90] 0.95 [ 0.70, 1.29] -0.28 [-0.87, 0.31] 0.20 [-0.23, 0.64] 50.13 [ 0.06, 65963.05]
Mean Perceived pushing target -> target 1.50 [ 0.54, 4.11] 1.00 [ 0.65, 1.54] 0.22 [-0.58, 1.01] -0.27 [-0.81, 0.27] 4.91 [ 0.01, 5541.92]
Mean Perceived pushing target -> agent 2.11 [ 0.73, 5.92] 1.31 [ 0.86, 2.00] 0.32 [-0.47, 1.10] -0.61* [-1.19, -0.03] 0.00 [ 0.00, 1.93]
Mean weartime NA NA 1.00 [ 1.00, 1.00] NA NA NA NA NA NA
Difference study group 2 NA NA NA NA NA NA NA NA NA NA
Difference study group 3 NA NA NA NA NA NA NA NA NA NA
Random Effects
sd(Intercept) 0.64 [ 0.47, 0.84] 0.30 [0.23, 0.39] 0.59 [0.46, 0.76] 0.27 [ 0.15, 0.42] 4.71 [ 2.84, 6.99]
sd(Daily perceived persuasion target -> target) 0.08 [ 0.00, 0.21] 0.05 [0.02, 0.08] 0.03 [0.00, 0.07] 0.05 [ 0.00, 0.13] 0.90 [ 0.05, 2.25]
sd(Daily perceived persuasion target -> agent) 0.07 [ 0.00, 0.19] 0.05 [0.02, 0.08] 0.06 [0.01, 0.11] 0.04 [ 0.00, 0.12] 2.06 [ 0.59, 3.85]
sd(Daily perceived pressure target -> target) 0.16 [ 0.01, 0.50] 0.05 [0.00, 0.14] 0.12 [0.01, 0.29] 0.38 [ 0.21, 0.60] 2.05 [ 0.10, 4.87]
sd(Daily perceived pressure target -> agent) 0.17 [ 0.01, 0.50] 0.04 [0.00, 0.10] 0.17 [0.02, 0.35] 0.22 [ 0.01, 0.59] 1.48 [ 0.06, 4.17]
sd(Daily perceived pushing target -> target) 0.24 [ 0.01, 0.54] 0.06 [0.00, 0.14] 0.09 [0.01, 0.18] 0.10 [ 0.01, 0.22] 1.10 [ 0.06, 2.74]
sd(Daily perceived pushing target -> agent) 0.11 [ 0.00, 0.30] 0.03 [0.00, 0.08] 0.05 [0.00, 0.13] 0.05 [ 0.00, 0.15] 0.94 [ 0.04, 2.78]
Additional Parameters
ar[1] 0.03 [-0.92, 0.95] 0.30 [0.26, 0.33] 0.45 [0.42, 0.48] 0.02 [-0.06, 0.11] 0.08 [-0.11, 0.28]
nu NA NA NA NA NA NA NA NA NA NA
shape 0.14 [ 0.13, 0.15] NA NA NA NA NA NA NA NA
sderr 0.05 [ 0.00, 0.15] NA NA NA NA NA NA 9.22 [ 5.50, 14.07]
sigma NA NA 0.55 [0.54, 0.57] 0.86 [0.84, 0.88] 0.93 [ 0.88, 0.98] NA NA
report::report_system()

Analyses were conducted using the R Statistical language (version 4.3.2; R Core Team, 2023) on Windows 11 x64 (build 22635)

report::cite_packages()